            var colors = ['red', 'green', 'blue', 'purple', 'gray', 'orange', 'black', 'white'];
            var icons = [];

            for (var loopr=0; loopr < colors.length; loopr++)
            {
                icon = new GIcon();
                icon.image = "http://labs.google.com/ridefinder/images/mm_20_" + colors[loopr] + ".png";
                icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
                icon.iconSize = new GSize(12, 20);
                icon.shadowSize = new GSize(22, 20);
                icon.iconAnchor = new GPoint(6, 20);
                icon.infoWindowAnchor = new GPoint(5, 1);

                icons.push(icon);
            }

            function initialize_stats(url, key, mapdivname, clat, clon, zl) {
                if (GBrowserIsCompatible()) {
                    map = new GMap2(document.getElementById(mapdivname));
                    map.setUIToDefault();
                    map.setCenter(new GLatLng(clat,clon), zl);

                }

                var script = document.createElement('script');
                script.src = 'http://' + url + '/measure/' + key + '/locations/values.gm?type=markers&callback=addMarkers&icon=icons[4]';
                document.body.appendChild(script);

            }


            function addPoly(polyline){
                map.addOverlay(polyline);
                var bounds = polyline.getBounds();
                map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
            }

            function addMarkers(object){
                mgr = new GMarkerManager(map);
                mgr.addMarkers(object.markers, 3);
                mgr.refresh();
            }


